﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._22_状态模式
{
    /// <summary>
    /// 已发货状态
    /// </summary>
    public class DeliveredState : IOrderState
    {
        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="order"></param>
        /// <exception cref="NotImplementedException"></exception>
        public void Cancel(Order order)
        {
            Console.WriteLine("错误：订单已发货，不能取消");
        }
        /// <summary>
        /// 订单发货
        /// </summary>
        /// <param name="order"></param>
        /// <exception cref="NotImplementedException"></exception>
        public void Deliver(Order order)
        {
            Console.WriteLine("错误：订单已完成");
        }
        /// <summary>
        /// 订单处理
        /// </summary>
        /// <param name="order"></param>
        /// <exception cref="NotImplementedException"></exception>
        public void Process(Order order)
        {
            Console.WriteLine("错误：订单已处理完成");
        }
        /// <summary>
        /// 订单发货
        /// </summary>
        /// <param name="order"></param>
        public void Ship(Order order)
        {
            Console.WriteLine("错误：订单已发货");
        }
    }
}
